//////////////////////////////////////////////////////////////////////////////
//	$File: $
//	$Revision: $
//	$Author: $
//	$DateTime: $
//	First Author: buggy

#ifndef	__tidyphotoconfig_h__
#define	__tidyphotoconfig_h__


#include	<QString>


class	QCommandLineParser;
class	QCommandLineOption;


//////////////////////////////////////////////////////////////////////
//	Tidy Photo Command Line Argument Parser
class	TidyPhotoArgParser
{
public:
	enum
	{
		TPARG_NONE	= 0,
		TPARG_APP,		//	"app"
		TPARG_MOVE,		//	"move or copy"
		TPARG_SRC,		//	"source"	
		TPARG_DST,		//	"destination"

		TPARG_MAX
	};

	struct	Def
	{
		const	char*	shortName;
		const	char*	longName;
		const	char*	valueName;
		const	char*	valueDefault;
		const	char*	desc;
	};


protected:
	TidyPhotoArgParser();
	~TidyPhotoArgParser();

	bool	Parse(int argc, char* argv[]);

	void	WriteHelp();

protected:
	QCommandLineParser*		_parser;
	QCommandLineOption*		_option[TPARG_MAX];
	QString					_helpText;


private:
	static	Def		_def[TPARG_MAX];


friend	class	TidyPhotoConfig;
};


//////////////////////////////////////////////////////////////////////
//	Tidy Photo Config
class	TidyPhotoConfig
{
public:
	static	TidyPhotoConfig*	ParseCommandLine(int argc, char* argv[]);

public:
	TidyPhotoConfig();
	~TidyPhotoConfig();

	void	Dump();


public:
	inline	bool	IsGui()			const	{	return _isGui;		}
	inline	bool	IsMoveFiles()	const	{	return _moveFiles;	}

	inline	const	char*	SourcePath()	const	{	return _srcPath;	}
	inline	const	char*	DestPath()		const	{	return _dstPath;	}


public:
	inline	void	SetGui(bool isGui)				{	_isGui		= isGui;	}
	inline	void	SetMoveFiles(bool moveFiles)	{	_moveFiles	= moveFiles;	}

			void	SetSourcePath(const char* srcPath);
			void	SetDestPath(const char* dstPath);
	

private:
	bool		_isGui;
	bool		_moveFiles;
	char*		_srcPath;
	char*		_dstPath;
};

#endif	//	__tidyphotoconfig_h__
